package org.kalai.unifypay.pay;

import java.util.Map;

import org.kalai.unifypay.Constant;
import org.kalai.unifypay.huanpay.HuanPay;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
/**
 * 微信主扫T1 D0
 * @author Renne66
 *
 */
public class Biz1001 implements Biz {

	@Override
	public Map<String, Object> pay(String tranxSN, long cent, String subject, String notifyUrl, String merchantCode, String bizData) {
		JSONObject jo = JSON.parseObject(bizData);
		if(jo == null) throw new RuntimeException("#211-bizData不能为空");
		String authCode = jo.getString("authCode");
		if(authCode == null) throw new RuntimeException("#211-authCode不能为空");
		return HuanPay.authPay(tranxSN, authCode, Constant.HUANPAY_NOTIFY_URL, cent, subject);
	}

	@Override
	public void afterPay(String tranxSN, String respCode, String respDesc, String transAmt) {
	}

}
